package com.cr.service;

import com.cr.dao.CustomerDao;
import com.cr.model.Customer;

public class CustomerService {
	private CustomerDao dao=new CustomerDao();
	
	/**
	 * 
	 * @param id
	 * @return
	 */
	public Customer getCustomer(long id)
	{
		return dao.getCustomer(id);
	}
	/**
	 * 
	 * @param name
	 * @param password
	 * @return
	 */
	public Customer getCustomer(String name,String password)
	{
		if(name==null || password==null)
			return null;
		return dao.getCustomer(name,password);
	}
	/**
	 * 
	 * @param customer
	 * @return
	 */
	public boolean addCustomer(Customer customer)
	{
		if(customer==null)
			return false;
		return dao.addCustomer(customer);
	}
	/**
	 * 
	 * @param customer
	 * @return
	 */
	public boolean updateCustomer(Customer customer)
	{
		if(customer==null)
			return false;
		return dao.updateCustomer(customer);
	}
	/**
	 * 
	 * @param id
	 * @return
	 */
	public boolean deleteCustomer(long id)
	{
		return dao.deleteCustomer(id);
	}

}
